package com.fr.cell.undo;

import javax.swing.undo.AbstractUndoableEdit;
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;

public class UndoStateEdit extends AbstractUndoableEdit
{
  private UndoState old;
  private UndoState cur;

  public UndoStateEdit(UndoState paramUndoState1, UndoState paramUndoState2)
  {
    this.old = paramUndoState1;
    this.cur = paramUndoState2;
  }

  public void undo()
    throws CannotUndoException
  {
    super.undo();
    if (this.old != null)
      this.old.applyState();
  }

  public void redo()
    throws CannotRedoException
  {
    super.redo();
    if (this.cur != null)
      this.cur.applyState();
  }
}